<?php

class Login extends _Controller
{
    private $users;

    public function __construct()
    {
        $this->importHelper('users');
        $this->users = new Users();
    }

    public function get()
    {
        $this->parseTemplate('login');
    }

    public function post()
    {
        $isUser = $this->users->CheckLogin(array('UserName' => $_POST['login_name'], 'Password' => $_POST['login_pass']));

        if($isUser != 0)
        {
            $this->users->LoginUser(array('ID' => $isUser));

            die('LoggedIn');
        } else {
            die('NotLoggedIn');
        }
    }
}